
package com.insigma.business.qrcode.intell.service.impl;


import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.intell.dao.CompanyIndustryTypeDao;
import com.insigma.business.qrcode.intell.dto.CompanyIndustryTypeBSearcher;
import com.insigma.business.qrcode.intell.entity.CompanyIndustryTypeDO;
import com.insigma.business.qrcode.intell.service.CompanyIndustryTypeService;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import org.apache.logging.log4j.util.Strings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("companyIndustryTypeService")
public class CompanyIndustryTypeServiceImpl implements CompanyIndustryTypeService {

    @Autowired(required = false)
    private CompanyIndustryTypeDao companyIndustryTypeDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<CompanyIndustryTypeDO> search(final CompanyIndustryTypeBSearcher companyIndustryTypeBSearcher) {
        return companyIndustryTypeDao.search(companyIndustryTypeBSearcher);
    }
   
    @Override
    public CompanyIndustryTypeDO get(final String id){
        return companyIndustryTypeDao.get(id);
    }

    
    @Override
    public Integer insert(final CompanyIndustryTypeDO companyIndustryTypeDO){
        if (Strings.isBlank(companyIndustryTypeDO.getId())) {
            companyIndustryTypeDO.setId(sequenceGenerator.genKey(SequenceNameConstant.COMPANY_INDUSTRY_TYPE_ID));
        }
        return companyIndustryTypeDao.insert(companyIndustryTypeDO);
    }

    
    @Override
    public Integer update(final CompanyIndustryTypeDO companyIndustryTypeDO){
        return companyIndustryTypeDao.update(companyIndustryTypeDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return companyIndustryTypeDao.delete(id,modifierType,modifierId);
    }

}
